/*
 * puzzleSettings.h
 *
 *  Created on: Sep 14, 2011
 *      Author: ewertz
 */

#ifndef PUZZLESETTINGS_H_
#define PUZZLESETTINGS_H_

#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <queue>
#include <vector>
using namespace std;


// DEBUG FLAGS
const bool debugAllNodes = false; // Prints out debug information for every node created or visited.
const bool debugMajorStateChanges = true; // this is for things like finding new solutions.
const bool debugCycles = false; // prints to std out when pruning due to cycle being found.

// STAT COLLECTING FLAGS
const bool stats = true;  // record stats under the scope of an IF statement, compiler will optimize if stats turned off.
const bool timing = false; // if this and stats are true then system will do several test runs on the configured board.

//ALGORITHM SWITCHING FLAGS
const bool advancedCycleCheck = false; // FASTER TO NOT CHECK "INTELLIGENTLY",  comparing hashes is quicker.
const bool calcHash = false; //if set to false then hash is part of cost function, else we calculate it.
const bool findBestSolution = true; // if true then keeps searching for best solution otherwise stops at first solution.
const double maxTime = 600000; // 300 seconds or 300,000 millisends, stop searching after 5 minutes.
/*
 * board representation.
 */

typedef unsigned char pos; //MAX NUMBER OF TILES

/*
 * COST FUNCTION COEFFICIENTS (WEIGHTS)
 */
const int coeff1 = 3;// # of moves so far
const int coeff2 = 0;//  number of tiles out of place
const int coeff3 = 3;// minimum possible distance between tile and correct position, used as metric for pruning
const int coeff4 = 5;// Weighting each tile's individual distance by their rank (max between needed row and column position) to create a push to get larger tiles move to their goal first.
const int coeff5 = 0;// not used yet.
const bool rankingOn = true; //toggle 1/0 to weight displacement of tiles by their rank.

/*
 * test board configurations
 */
const int testBoard = 1; // this + width select which test board we use from memory.
const int width = 4;  //width of board
const int size = width*width; //number of tiles

/*
 * Memory allocation.
 */
const unsigned long memSize = 20000000; //preallocate nodes.
const unsigned long maxMemSize = 30000000; //max memory allocation

//TO CHANGE PRIORITY OF CHECKING CHILD NODES, REASSIGN VALUES.  1 is higher prioirity.
const int NORTH = 1;
const int SOUTH = 2;
const int EAST = 3;
const int WEST = 4;

#endif /* PUZZLESETTINGS_H_ */
